home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
network
/
pctkn_v1.zip
/
PC_TOKEN.ASM
< prev
next >
Wrap
Assembly Source File
|
1994-07-11
|
77KB
|
2,091 lines
;***************************************************************
;* PC_TOKEN.ASM by Andrew Lee NCU M.E. R.O.C. 1994 *
;* E-Mail Address : u330633@sparc12.ncu.edu.tw (Internet) *
;* Postal Address : National Central Univ. *
;* Mechanical Dept. 4B, R.O.C. *
;***************************************************************
TITLE Asynchronous Serial Communication
DOSSEG
KBDAT EQU 60h ;Keyboard Buffer
KBSTATUS EQU 64h ;Keyboard Status
PICIMR EQU 21h ;PIC IMR
SEND_PORT EQU 2f8h ;COM2
RCV_PORT EQU 3f8h ;COM1
SOUND_SWITCH EQU 61h ;8255
SOUND_PORT EQU 42h ;8254 Counter2
SOUND_CONTROL EQU 43h ;8254 Command Word
GET_MODE EQU 0h ;GPSCR MODE
PUT_MODE EQU 1h ;GPSCR MODE
YES EQU 1h ;Boolen Value
NO EQU 0h ;Boolen Value
F1 EQU 1 ;Function Key ID
F2 EQU 2 ;Function Key ID
F3 EQU 3 ;Function Key ID
F4 EQU 4 ;Function Key ID
RETURN EQU 5 ;Function Key ID
BACK EQU 6 ;Function Key ID
ESCAPE EQU 7 ;Function Key ID
NOTHING EQU 20 ;Function Key ID
NULL EQU 0 ;Signal ID
ETX EQU 3 ;Signal ID
CAN EQU 24 ;Signal ID
DLE EQU 16 ;Signal ID
SOH EQU 1 ;Signal ID
ETB EQU 23 ;Signal ID
NAK EQU 21 ;Signal ID
ACK EQU 6 ;Signal ID
.MODEL SMALL
.STACK
;-------------------------------------------------------------------------------
; DATA SEGMENT
;-------------------------------------------------------------------------------
.DATA
MAIN_SCR DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'╔',15,'═',15,'═',15,' ',15,'[',15,'|',15,']',15
DB ' ',15,'S',15,'e',15,'n',15,'d',15,'e',15,'r',15,'(',15
DB ' ',15,')',15,' ',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'╗',15,'░',23,'░',23,'░',23
DB '░',23,'║',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,'║',15,'▓',24,'▓',24,'░',23
DB '░',23,'║',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,'║',15,'▓',24,'▓',24,'░',23
DB '░',23,'║',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,'║',15,'▓',24,'▓',24,'░',23
DB '░',23,'║',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,'║',15,'▓',24,'▓',24,'░',23
DB '░',23,'║',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,'║',15,'▓',24,'▓',24,'░',23
DB '░',23,'║',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,'║',15,'▓',24,'▓',24,'░',23
DB '░',23,'║',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,'║',15,'▓',24,'▓',24,'░',23
DB '░',23,'╟',15,'─',15,'─',15,' ',15,'[',15,'|',15,']',15
DB ' ',15,'R',15,'e',15,'c',15,'e',15,'i',15,'v',15,'e',15
DB 'r',15,' ',15,'─',15,'─',15,'─',15,'─',15,'─',15,'─',15
DB '─',15,'─',15,'─',15,'─',15,'─',15,'─',15,'─',15,'─',15
DB '─',15,'─',15,'─',15,'─',15,'─',15,'─',15,'─',15,'─',15
DB '─',15,'─',15,'─',15,'─',15,'─',15,'─',15,'─',15,'─',15
DB '─',15,'─',15,'─',15,'─',15,'─',15,'─',15,'─',15,'─',15
DB '─',15,'─',15,'─',15,'─',15,'─',15,'─',15,'─',15,'─',15
DB '─',15,'─',15,'─',15,'─',15,'─',15,'─',15,'─',15,'─',15
DB '─',15,'─',15,'─',15,'─',15,'╢',15,'▓',24,'▓',24,'░',23
DB '░',23,'║',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,'║',15,'▓',24,'▓',24,'░',23
DB '░',23,'║',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,'║',15,'▓',24,'▓',24,'░',23
DB '░',23,'║',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,'║',15,'▓',24,'▓',24,'░',23
DB '░',23,'║',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,'║',15,'▓',24,'▓',24,'░',23
DB '░',23,'║',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,'║',15,'▓',24,'▓',24,'░',23
DB '░',23,'║',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,'║',15,'▓',24,'▓',24,'░',23
DB '░',23,'║',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
DB ' ',15,' ',15,' ',15,' ',15,'║',15,'▓',24,'▓',24,'░',23
DB '░',23,'╚',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15
DB '═',15,'═',15,'═',15,'═',15,'╝',15,'▓',24,'▓',24,'░',23
DB '░',23,'░',23,'░',23,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24
DB '▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24
DB '▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24
DB '▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24
DB '▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24
DB '▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24
DB '▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24
DB '▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24
DB '▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24
DB '▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'▓',24,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'┌',31,'─',31,'─',31,'─',31,'─',31,'─',31
DB '─',31,'─',31,'─',31,'─',31,'─',31,'─',31,'─',31,'─',31
DB '─',31,'─',31,'─',31,'─',31,'─',31,'─',31,'─',31,'─',31
DB '─',31,'─',31,'─',31,'┐',16,'░',23,'░',23,'┌',16,'─',16
DB '─',16,' ',16,'D',31,'e',31,'s',31,'t',31,'i',31,'n',31
DB 'a',31,'t',31,'i',31,'o',31,'n',31,' ',16,'─',16,'─',16
DB '─',16,'┐',31,'░',23,'░',23,'┌',31,'─',31,'─',31,'─',31
DB '─',31,'─',31,'─',31,'─',31,'─',31,'─',31,'─',31,'─',31
DB '─',31,'─',31,'─',31,'─',31,'─',31,'─',31,'─',31,'─',31
DB '─',31,'─',31,'─',31,'─',31,'─',31,'┐',16,'░',23,'░',23
DB '░',23,'░',23,'│',31,' ',31,'C',31,'u',31,'r',31,'r',31
DB 'e',31,'n',31,'t',31,' ',31,'T',31,'i',31,'m',31,'e',31
DB ' ',31,' ',31,' ',31,' ',31,' ',31,' ',31,' ',31,' ',31
DB ' ',31,' ',31,' ',31,'│',16,'░',23,'░',23,'│',16,' ',31
DB ' ',31,' ',31,' ',31,' ',31,' ',31,' ',31,' ',31,' ',31
DB ' ',31,' ',31,' ',31,' ',31,' ',31,' ',31,' ',31,' ',31
DB ' ',31,'│',31,'░',23,'░',23,'│',31,' ',31,'T',31,'a',31
DB 'l',31,'k',31,'e',31,'r',31,' ',31,'(',31,'R',31,'S',31
DB '2',31,'3',31,'2',31,')',31,' ',31,'V',31,'e',31,'r',31
DB ' ',31,'1',31,'.',31,'0',31,' ',31,'│',16,'░',23,'░',23
DB '░',23,'░',23,'└',31,'─',16,'─',16,'─',16,'─',16,'─',16
DB '─',16,'─',16,'─',16,'─',16,'─',16,'─',16,'─',16,'─',16
DB '─',16,'─',16,'─',16,'─',16,'─',16,'─',16,'─',16,'─',16
DB '─',16,'─',16,'─',16,'┘',16,'░',23,'░',23,'└',16,'─',31
DB '─',31,'─',31,'─',31,'─',31,'─',31,'─',31,'─',31,'─',31
DB '─',31,'─',31,'─',31,'─',31,'─',31,'─',31,'─',31,'─',31
DB '─',31,'┘',31,'░',23,'░',23,'└',31,'─',16,'─',16,'─',16
DB '─',16,'─',16,'─',16,'─',16,'─',16,'─',16,'─',16,'─',16
DB '─',16,'─',16,'─',16,'─',16,'─',16,'─',16,'─',16,'─',16
DB '─',16,'─',16,'─',16,'─',16,'─',16,'┘',16,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB '░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23,'░',23
DB ' ',95,' ',95,'F',91,'1',91,'-',95,'S',95,'e',95,'n',95
DB 'd',95,' ',95,' ',95,'F',91,'2',91,'-',95,'M',95,'u',95
DB 's',95,'i',95,'c',95,'(',95,'X',95,')',95,' ',95,' ',95
DB 'F',91,'3',91,'-',95,'C',95,'L',95,'R',95,'_',95,'S',95
DB 'e',95,'n',95,'d',95,'e',95,'r',95,' ',95,' ',95,'F',91
DB '4',91,'-',95,'C',95,'L',95,'R',95,'_',95,'R',95,'e',95
DB 'c',95,'e',95,'i',95,'v',95,'e',95,'r',95,' ',95,' ',95
DB '<',95,' ',95,' ',95,' ',95,' ',95,' ',95,' ',95,' ',95
DB ' ',95,' ',95,' ',95,' ',95,' ',95,' ',95,' ',95,' ',95
DB ' ',95,' ',95,' ',95,' ',95,' ',95,'>',95,' ',95,' ',95
FONT DB 000h,000h,000h,000h,000h,000h,000h,000h ;32
DB 000h,000h,000h,000h,000h,000h,000h,000h
DB 000h,000h,010h,030h,030h,030h,030h,030h ;33
DB 020h,000h,030h,030h,000h,000h,000h,000h
DB 000h,024h,06Ch,06Ch,048h,000h,000h,000h ;34
DB 000h,000h,000h,000h,000h,000h,000h,000h
DB 000h,000h,024h,06Ch,06Ch,0FEh,06Ch,06Ch ;35
DB 0FEh,06Ch,06Ch,048h,000h,000h,000h,000h
DB 000h,000h,010h,07Eh,0FCh,0D0h,0D0h,07Ch ;36
DB 016h,016h,07Eh,0FCh,010h,000h,000h,000h
DB 000h,006h,0C6h,0CCh,0CCh,018h,018h,030h ;37
DB 030h,066h,066h,0C6h,0C0h,000h,000h,000h
DB 000h,000h,018h,03Ch,024h,038h,018h,07Ah ;38
DB 0CCh,0CCh,0D6h,074h,000h,000h,000h,000h
DB 000h,018h,018h,008h,010h,000h,000h,000h ;39
DB 000h,000h,000h,000h,000h,000h,000h,000h
DB 000h,006h,00Ch,01Ch,018h,018h,018h,018h ;40
DB 018h,018h,01Ch,00Ch,006h,000h,000h,000h
DB 000h,0C0h,060h,070h,030h,030h,030h,030h ;41
DB 030h,030h,070h,060h,0C0h,000h,000h,000h
DB 000h,000h,000h,000h,06Ch,038h,0FEh,038h ;42
DB 06Ch,000h,000h,000h,000h,000h,000h,000h
DB 000h,000h,000h,010h,030h,030h,07Ch,0F8h ;43
DB 030h,030h,020h,000h,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,000h,000h,000h ;44
DB 000h,000h,030h,030h,010h,020h,000h,000h
DB 000h,000h,000h,000h,000h,07Eh,0FCh,000h ;45
DB 000h,000h,000h,000h,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,000h,000h,000h ;46
DB 000h,000h,030h,030h,000h,000h,000h,000h
DB 000h,006h,006h,00Ch,00Ch,018h,018h,030h ;47
DB 030h,060h,060h,0C0h,0C0h,000h,000h,000h
DB 000h,000h,07Ch,0FEh,0C6h,0C6h,0D6h,0D6h ;48
DB 0C6h,0C6h,0FEh,07Ch,000h,000h,000h,000h
DB 000h,000h,018h,078h,0D8h,018h,018h,018h ;49
DB 018h,018h,07Eh,0FCh,000h,000h,000h,000h
DB 000h,000h,038h,07Ch,0ECh,0CCh,00Ch,00Ch ;50
DB 01Ch,038h,07Eh,0FCh,000h,000h,000h,000h
DB 000h,000h,07Ch,0FEh,006h,006h,03Eh,07Eh ;51
DB 006h,006h,07Eh,0FCh,000h,000h,000h,000h
DB 000h,000h,044h,0CCh,0CCh,0CCh,0FEh,07Ch ;52
DB 00Ch,00Ch,00Ch,008h,000h,000h,000h,000h
DB 000h,000h,07Eh,0FCh,0C0h,0C0h,0FCh,07Eh ;53
DB 006h,006h,07Ch,0F8h,000h,000h,000h,000h
DB 000h,000h,03Ch,07Eh,0E2h,0C0h,0FCh,0FCh ;54
DB 0C6h,0C6h,07Eh,03Ch,000h,000h,000h,000h
DB 000h,000h,07Eh,0FEh,006h,006h,00Ch,07Eh ;55
DB 018h,018h,030h,030h,000h,000h,000h,000h
DB 000h,000h,038h,07Ch,04Ch,04Ch,07Ch,0C6h ;56
DB 0C6h,0C6h,0FEh,07Ch,000h,000h,000h,000h
DB 000h,000h,07Ch,0FEh,0C6h,0C6h,0FEh,07Eh ;57
DB 006h,006h,01Eh,03Ch,000h,000h,000h,000h
DB 000h,000h,000h,030h,030h,000h,000h,000h ;58
DB 000h,030h,030h,000h,000h,000h,000h,000h
DB 000h,000h,000h,030h,030h,000h,000h,000h ;59
DB 000h,030h,030h,010h,020h,000h,000h,000h
DB 000h,006h,00Ch,018h,030h,060h,0C0h,0C0h ;60
DB 060h,030h,018h,00Ch,006h,000h,000h,000h
DB 000h,000h,000h,07Eh,0FCh,000h,07Eh,0FCh ;61
DB 000h,000h,000h,000h,000h,000h,000h,000h
DB 000h,0C0h,060h,030h,018h,00Ch,006h,006h ;62
DB 00Ch,018h,030h,060h,0C0h,000h,000h,000h
DB 000h,000h,07Ch,0C6h,0C6h,086h,00Ch,00Ch ;63
DB 018h,000h,018h,018h,000h,000h,000h,000h
DB 000h,000h,03Ch,07Eh,0C6h,0DEh,0DEh,0D6h ;64
DB 0D6h,0DEh,0DEh,0C0h,07Eh,000h,000h,000h
DB 000h,000h,010h,038h,038h,038h,06Ch,06Ch ;65
DB 07Ch,0C6h,0C6h,084h,000h,000h,000h,000h
DB 000h,000h,0FCh,0FEh,0C6h,0C6h,0FCh,0C6h ;66
DB 0C6h,0C6h,0FEh,0FCh,000h,000h,000h,000h
DB 000h,000h,07Eh,0FCh,0E0h,0C0h,0C0h,0C0h ;67
DB 0C0h,0E0h,0FEh,07Ch,000h,000h,000h,000h
DB 000h,000h,0F8h,0FCh,0CCh,0C6h,0C6h,0C6h ;68
DB 0C6h,0CCh,0FCh,0F8h,000h,000h,000h,000h
DB 000h,000h,0FEh,0FCh,0C0h,0C0h,0F8h,0F0h ;69
DB 0C0h,0C0h,0FEh,0FCh,000h,000h,000h,000h
DB 000h,000h,0FEh,0FCh,0C0h,0C0h,0F8h,0F0h ;70
DB 0C0h,0C0h,0C0h,080h,000h,000h,000h,000h
DB 000h,000h,07Eh,0FCh,0C0h,0C0h,0CEh,0DEh ;71
DB 0C6h,0C6h,0FEh,07Ch,000h,000h,000h,000h
DB 000h,000h,042h,0C6h,0C6h,0C6h,0FEh,0FEh ;72
DB 0C6h,0C6h,0C6h,084h,000h,000h,000h,000h
DB 000h,000h,07Eh,0FCh,030h,030h,030h,030h ;73
DB 030h,030h,07Eh,0FCh,000h,000h,000h,000h
DB 000h,000h,07Eh,0FCh,00Ch,00Ch,00Ch,00Ch ;74
DB 00Ch,04Ch,0FCh,078h,000h,000h,000h,000h
DB 000h,000h,042h,0C6h,0CCh,0D8h,0F0h,0F8h ;75
DB 0CCh,0C4h,0C6h,082h,000h,000h,000h,000h
DB 000h,000h,040h,0C0h,0C0h,0C0h,0C0h,0C0h ;76
DB 0C0h,0C0h,0FEh,0FCh,000h,000h,000h,000h
DB 000h,000h,082h,0C6h,0EEh,0D6h,0C6h,0C6h ;77
DB 0C6h,0C6h,0C6h,084h,000h,000h,000h,000h
DB 000h,000h,082h,0C6h,0E6h,0E6h,0F6h,0DEh ;78
DB 0CEh,0CEh,0C6h,082h,000h,000h,000h,000h
DB 000h,000h,07Ch,0FEh,0C6h,0C6h,0C6h,0C6h ;79
DB 0C6h,0C6h,0FEh,07Ch,000h,000h,000h,000h
DB 000h,000h,078h,0FCh,0C6h,0C6h,0C6h,0FCh ;80
DB 0F8h,0C0h,0C0h,080h,000h,000h,000h,000h
DB 000h,000h,07Ch,0FEh,0C6h,0C6h,0C6h,0D6h ;81
DB 0D6h,0CEh,0FEh,07Ch,006h,000h,000h,000h
DB 000h,000h,078h,0FCh,0C6h,0C6h,0C6h,0FCh ;82
DB 0F8h,0D8h,0CCh,086h,000h,000h,000h,000h
DB 000h,000h,07Eh,0FCh,0C0h,0C0h,0FCh,07Eh ;83
DB 006h,006h,07Eh,0FCh,000h,000h,000h,000h
DB 000h,000h,07Eh,0FCh,030h,030h,030h,030h ;84
DB 030h,030h,030h,020h,000h,000h,000h,000h
DB 000h,000h,042h,0C6h,0C6h,0C6h,0C6h,0C6h ;85
DB 0C6h,0C6h,0FEh,07Ch,000h,000h,000h,000h
DB 000h,000h,0C6h,0C6h,0C6h,06Ch,06Ch,06Ch ;86
DB 038h,038h,038h,010h,000h,000h,000h,000h
DB 000h,000h,052h,0D6h,0D6h,0D6h,0D6h,07Ch ;87
DB 06Ch,06Ch,06Ch,028h,000h,000h,000h,000h
DB 000h,000h,0C6h,0C6h,06Ch,06Ch,038h,038h ;88
DB 038h,038h,06Ch,0EEh,000h,000h,000h,000h
DB 000h,000h,042h,0C6h,06Ch,06Ch,038h,030h ;89
DB 030h,030h,030h,020h,000h,000h,000h,000h
DB 000h,000h,07Eh,0FCh,00Ch,018h,0FEh,030h ;90
DB 030h,060h,07Eh,0FCh,000h,000h,000h,000h
DB 000h,01Eh,01Ch,018h,018h,018h,018h,018h ;91
DB 018h,018h,018h,01Eh,01Ch,000h,000h,000h
DB 000h,0C0h,0C0h,060h,060h,030h,030h,018h ;92
DB 018h,00Ch,00Ch,006h,006h,000h,000h,000h
DB 000h,070h,0F0h,030h,030h,030h,030h,030h ;93
DB 030h,030h,030h,070h,0F0h,000h,000h,000h
DB 010h,06Ch,0C6h,000h,000h,000h,000h,000h ;94
DB 000h,000h,000h,000h,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,000h,000h,000h ;95
DB 000h,000h,000h,000h,000h,0FFh,000h,000h
DB 000h,018h,018h,010h,008h,000h,000h,000h ;96
DB 000h,000h,000h,000h,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,078h,0FCh,0CCh ;97
DB 0CCh,0DCh,0FCh,06Eh,000h,000h,000h,000h
DB 000h,000h,040h,0C0h,0C0h,0DCh,0FEh,0E6h ;98
DB 0C6h,0C6h,0FEh,07Ch,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,07Ch,0FEh,0C2h ;99
DB 0C0h,0C0h,0FCh,07Eh,000h,000h,000h,000h
DB 000h,000h,002h,006h,006h,076h,0FEh,0CEh ;100
DB 0C6h,0C6h,0FEh,07Eh,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,038h,07Ch,0C6h ;101
DB 0FEh,0C0h,0FEh,07Ch,000h,000h,000h,000h
DB 000h,000h,000h,01Ch,036h,036h,030h,0FCh ;102
DB 030h,030h,030h,020h,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,07Ch,0FEh,0C6h ;103
DB 0C6h,0C6h,07Eh,006h,07Eh,0FCh,000h,000h
DB 000h,000h,040h,0C0h,0C0h,0DCh,0FEh,0E6h ;104
DB 0C6h,0C6h,0C6h,084h,000h,000h,000h,000h
DB 000h,000h,000h,018h,000h,008h,018h,018h ;105
DB 018h,018h,018h,010h,000h,000h,000h,000h
DB 000h,000h,000h,018h,000h,008h,018h,018h ;106
DB 018h,058h,0D8h,0F8h,070h,000h,000h,000h
DB 000h,000h,040h,0C0h,0C0h,0C6h,0CCh,0D8h ;107
DB 0F8h,0CCh,0C6h,086h,000h,000h,000h,000h
DB 000h,000h,010h,030h,030h,030h,030h,030h ;108
DB 030h,030h,030h,020h,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,07Ch,0FEh,0D6h ;109
DB 0D6h,0D6h,0D6h,094h,000h,000h,000h,000h
DB 000h,000h,000h,000h,040h,0DCh,0FEh,0E6h ;110
DB 0C6h,0C6h,0C6h,084h,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,07Ch,0FEh,0C6h ;111
DB 0C6h,0C6h,0FEh,07Ch,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,07Ch,0FEh,0C6h ;112
DB 0C6h,0E6h,0FEh,0DCh,0C0h,080h,000h,000h
DB 000h,000h,000h,000h,000h,07Ch,0FEh,0C6h ;113
DB 0C6h,0CEh,0FEh,076h,006h,004h,000h,000h
DB 000h,000h,000h,000h,000h,040h,0FCh,0E6h ;114
DB 0C2h,0C0h,0C0h,080h,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,07Eh,0FCh,0C0h ;115
DB 0FEh,006h,07Eh,0FCh,000h,000h,000h,000h
DB 000h,000h,010h,030h,030h,07Eh,0FCh,030h ;116
DB 030h,030h,030h,020h,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,042h,0C6h,0C6h ;117
DB 0C6h,0C6h,0FEh,07Ch,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,0C6h,0C6h,06Ch ;118
DB 06Ch,038h,038h,010h,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,052h,0D6h,0D6h ;119
DB 06Ch,06Ch,06Ch,028h,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,082h,0C6h,06Ch ;120
DB 038h,038h,06Ch,0C6h,000h,000h,000h,000h
DB 000h,000h,000h,000h,000h,082h,0C6h,066h ;121
DB 03Ch,01Ch,018h,030h,060h,0C0h,000h,000h
DB 000h,000h,000h,000h,000h,07Eh,0FCh,00Ch ;122
DB 018h,030h,07Eh,0FCh,000h,000h,000h,000h
DB 000h,00Eh,01Ch,018h,018h,018h,030h,030h ;123
DB 018h,018h,018h,01Ch,00Eh,000h,000h,000h
DB 000h,000h,010h,030h,030h,030h,020h,010h ;124
DB 030h,030h,030h,020h,000h,000h,000h,000h
DB 000h,0E0h,070h,030h,030h,030h,018h,018h ;125
DB 030h,030h,030h,070h,0E0h,000h,000h,000h
DB 000h,076h,0DCh,000h,000h,000h,000h,000h ;126
DB 000h,000h,000h,000h,000h,000h,000h,000h
DB 000h,000h,010h,028h,06Ch,06Ch,0C6h,0C6h ;127
DB 0C6h,0C6h,0FEh,0FEh,000h,000h,000h,000h
DB 000h,001h,07fh,005h,009h,031h,0c1h,00fh ;lee
DB 000h,001h,07fh,001h,001h,005h,002h,000h
DB 000h,000h,0fch,040h,030h,00eh,004h,0e0h
DB 040h,088h,0fch,000h,000h,000h,000h,000h
DB 000h,010h,010h,000h,0feh,000h,07ch,003h
DB 07ch,000h,07dh,046h,044h,07ch,044h,000h
DB 000h,020h,010h,000h,0e0h,020h,024h,0a8h
DB 0b0h,0a0h,030h,024h,026h,060h,020h,000h
DB 000h,081h,041h,002h,0f4h,02fh,044h,087h
DB 040h,021h,021h,022h,02ch,050h,08fh,000h
DB 000h,010h,0f8h,010h,002h,0fch,044h,0fch
DB 0a0h,030h,02ah,022h,01eh,000h,0feh,000h
DB 000h,014h,03fh,044h,07fh,004h,03fh,024h
DB 006h,0ffh,04dh,014h,025h,0c6h,04ch,000h
DB 000h,004h,024h,024h,0a4h,024h,084h,08ch
DB 004h,0feh,010h,0a0h,040h,020h,01ch,000h
DB 000h,009h,009h,011h,012h,032h,054h,098h
DB 010h,010h,010h,010h,010h,010h,010h,000h
DB 000h,000h,004h,0f7h,080h,080h,088h,0f7h
DB 080h,080h,084h,0f7h,080h,080h,080h,000h
DB 000h,002h,0ffh,088h,0ffh,081h,0ffh,088h
DB 0ffh,000h,03fh,024h,024h,024h,0ffh,000h
DB 000h,020h,020h,03eh,020h,040h,000h,03eh
DB 000h,000h,0f8h,048h,048h,048h,0feh,000h
DB 000h,001h,001h,001h,07fh,041h,041h,041h
DB 07fh,041h,001h,001h,001h,001h,001h,000h
DB 000h,000h,000h,004h,0feh,004h,004h,004h
DB 0fch,004h,000h,000h,000h,000h,000h,000h
DB 000h,001h,001h,01fh,011h,011h,011h,011h
DB 0ffh,001h,002h,004h,008h,030h,0c0h,000h
DB 000h,000h,010h,0f8h,010h,010h,010h,010h
DB 0feh,000h,080h,040h,030h,00eh,004h,000h
DB 000h,021h,022h,024h,027h,0fah,025h,023h
DB 020h,077h,0aah,022h,025h,028h,020h,000h
DB 000h,048h,048h,0d0h,07eh,048h,054h,0fch
DB 044h,0feh,044h,028h,010h,0aah,046h,000h
DB 000h,010h,010h,010h,017h,0fch,032h,03ah
DB 057h,052h,092h,014h,018h,010h,013h,000h
DB 000h,020h,028h,024h,0feh,020h,0a0h,0a4h
DB 0e4h,0a8h,0a8h,0b0h,052h,08ah,006h,000h
DB 000h,001h,001h,021h,021h,021h,03fh,021h
DB 001h,021h,021h,021h,021h,07fh,021h,000h
DB 000h,000h,000h,008h,008h,008h,0f8h,008h
DB 000h,004h,004h,004h,004h,0f6h,004h,000h
DB 000h,00fh,008h,008h,008h,00fh,008h,000h
DB 07eh,062h,062h,062h,062h,07eh,042h,000h
DB 000h,0e0h,020h,020h,020h,0e0h,020h,000h
DB 0fch,084h,084h,084h,084h,0fch,084h,000h
DB 000h,07fh,044h,07fh,008h,010h,025h,07ah
DB 010h,024h,0feh,010h,054h,054h,010h,000h
DB 000h,0fch,044h,0fch,004h,090h,0fch,090h
DB 0fch,090h,0fch,090h,090h,0fch,080h,000h
DB 000h,001h,001h,0ffh,001h,001h,03fh,000h
DB 000h,01fh,010h,010h,010h,01fh,010h,000h
DB 000h,000h,004h,0feh,000h,010h,0f8h,000h
DB 010h,0f8h,010h,010h,010h,0f0h,010h,000h
DB 000h,00fh,008h,00fh,008h,00fh,000h,03fh
DB 030h,030h,03fh,030h,030h,03fh,030h,000h
DB 000h,0f0h,010h,0f0h,010h,0f0h,000h,0fch
DB 004h,004h,0fch,004h,004h,0fch,004h,000h
;-------------------------------------------------------------------------------
; CODE SEGMENT
;-------------------------------------------------------------------------------
.CODE
;Storage for old interrupt routine
;===================================
video_base DW ?
old_1c_seg DW ?
old_1c_off DW ?
old_9_seg DW ?
old_9_off DW ?
old_b_seg DW ?
old_b_off DW ?
old_c_seg DW ?
old_c_off DW ?
; The following is for song
;===================================
song_index DB 'X1234' ;Index
song_sign DB ?,95 ;Index Char on Screen
song_ptr DW 0h ;Pointer of Song Addr
song_flag DB 0h ;Music On or Off
song_pointer DW 0h ;Pointer of Song Data
song_frequency DW 0h ;Freq. Divider for 8254
song_tick DW 0h ;Song Tick
song_counter DW 0h ;Song Accumulator
song_state DB 0h ;Speaker On or Off
song_addr DW music1,music1,music2,music3,music4
music1 DW 2704,3,1,1805,3,1,1805,3,1,1805,3,1,1805,7,6,2027,3,1
DW 2275,3,1,2027,3,1,2275,3,1,2409,3,1,2704,13,5
DW 1352,3,1,1352,3,1,1352,3,1,1352,3,1,1352,7,6,1517,3,1
DW 3036,3,1,1517,3,1,1432,3,1,1704,3,1,1805,13,5
DW 1805,3,1,1352,3,1,1352,3,1,1517,3,1,1805,7,6,2027,3,1
DW 2275,3,1,2027,3,1,2275,3,1,2409,3,1,2704,7,6,3606,3,1
DW 3606,3,1,2275,3,1,2275,3,1,2409,3,1,2704,7,6,1805,3,1
DW 2027,3,1,2275,3,1,2409,3,1,3035,3,1,2704,10,3
DW 65535
music2 DW 4047,3,1,3216,3,1,2704,3,1,2704,3,5,1352,1,3,1352,1,7
DW 1608,1,3,1608,1,7,4047,3,1,4047,3,1,3213,3,1,2704,3,1
DW 2704,3,5,1352,1,3,1352,1,7,1517,1,3
DW 1517,1,7,4296,3,1,4296,3,1,3606,3,1,2409,3,1,2409,3,5
DW 1204,1,3,1204,1,7,1517,1,3
DW 1517,1,7,4296,3,1,4296,3,1,3606,3,1,2409,3,1,2409,3,5
DW 1204,1,3,1204,1,7,1608,1,3,1608,1,7
DW 4047,3,1,3216,3,1,2704,3,1,2027,3,5
DW 1012,1,3,1012,1,7,1352,1,3,1352,1,7,4047,3,1
DW 4047,3,1,3216,3,1,2704,3,1,2027,3,5,1012,1,3
DW 1012,1,5,1204,1,3,1204,1,7,3606,1,1,3606,3,1
DW 3035,3,1,2409,1,3,2409,11,5,2867,3,1,2704,3,1,1608,12,4
DW 2027,3,1,3216,3,1,3216,6,2,3606,3,1,2409,6,2,2704,3,1,4047,3,3
DW 4047,1,1,4047,3,9,2704,1,3,3035,1,7,2704,1,3
DW 3035,1,7,2704,3,1,1608,12,4,1805,3,1,2704,1,3
DW 3216,1,7,2704,1,3,3216,1,7,2704,3,1
DW 1805,3,1,2704,3,1,2027,3,1,1805,3,1,1608,3,1,1352,6,2
DW 1517,3,1,1608,1,1,1608,1,1,1608,3,1,1805,1,3,2027,3,9
DW 65535
music3 DW 1806,3,1,2705,27,1
DW 1,23,1,2705,2,1,2409,2,1,2275,2,1,2705,2,1
DW 1806,3,1,2705,3,1,2705,23,1
DW 1,23,1,2705,2,1,2409,2,1,2275,2,1,2705,2,1
DW 1806,15,1,2705,15,1
DW 1,20,1,2409,3,1,2275,3,1,2027,3,1
DW 1806,31,1
DW 1,31,1
DW 1352,7,1,2275,3,1,2275,19,1
DW 2275,7,1,1,3,1,1352,3,1,1518,3,1,1705,3,1,1806,3,1,1705,3,1
DW 1518,15,1,1518,3,1,1,11,1
DW 1,11,1,1518,3,1,1705,3,1,1806,3,1,2027,3,1,1806,3,1
DW 1705,7,1,1705,2,1,1806,2,1,1705,21,1
DW 1,11,1,1705,3,1,1806,3,1,2027,3,1,2275,3,1,2027,3,1
DW 1806,31,1
DW 1,31,1
DW 1352,7,1,1352,3,1,1,12,1
DW 1,7,1,1352,7,1,1518,7,1,1705,7,1
DW 1518,19,1,1518,3,1,1,12,1
DW 1,7,1,1518,7,1,1705,7,1,1806,7,1
DW 1705,19,1,1705,3,1,1,12,1
DW 1,19,1,2409,3,1,2409,3,1,2275,3,1,2027,3,1
DW 1806,31,1
DW 1806,3,1,2705,27,1
DW 1,23,1,2705,2,1,2409,2,1,2275,2,1,2705,2,1
DW 1806,3,1,2705,3,1,2705,23,1
DW 1,23,1,2705,2,1,2409,2,1,2275,2,1,2705,2,1
DW 1806,15,1,2705,15,1
DW 1,19,1,2409,3,1,2275,3,1,2027,3,1
DW 1806,31,1
DW 1,7,1,1806,31,1
DW 65535
music4 DW 1352,3,1,1352,3,1,1204,3,1,1138,3,1,1013,3,1,1138,3,1,1204,3,1,1352,3,1
DW 1,3,1,1204,7,1,1518,3,1,1352,23,1
DW 1,3,1,1352,3,1,1204,3,1,1138,3,1
DW 1013,3,1,1138,3,1,1204,3,1,1352,3,1,1,3,1,1013,7,1,1138,3,1
DW 903,31,1
DW 1,3,1,852,2,1,852,5,1,903,3,1,903,3,1,1013,3,1,1013,2,1,2275,3,1
DW 1,3,1,1013,2,1,1138,2,1,1013,2,1,1138,3,1,903,7,1,1013,2,1,1138,3,1
DW 1352,63,1
DW 1,3,1,1352,3,1,676,3,1,759,3,1,676,3,1,759,2,1,903,9,1
DW 1,3,1,1013,3,1,1013,3,1,903,3,1,1013,3,1,1138,2,1,903,9,1
DW 1,3,1,852,3,1,852,3,1,852,2,1,759,2,1,852,7,1,903,3,1,1013,3,1
DW 903,15,1,676,15,1
DW 1,3,1,1352,3,1,676,3,1,759,3,1,676,3,1,759,2,1,903,9,1
DW 1,3,1,1013,3,1,1013,3,1,903,3,1,1013,3,1,1138,2,1,903,9,1
DW 1,3,1,852,3,1,852,3,1,852,2,1,759,2,1,852,7,1,903,3,1,1013,3,1
DW 903,31,1
DW 1,3,1,1013,3,1,1013,3,1,1138,3,1,1013,39,1
DW 1138,3,1,1204,3,1
DW 1352,63,1
DW 1,3,1,1352,3,1,1204,3,1,1138,3,1,1013,3,1,1138,3,1,1204,3,1,1352,3,1
DW 1,3,1,1204,7,1,1518,3,1,1352,31,1
DW 1,3,1,1352,3,1,1204,3,1,1138,3,1
DW 1013,3,1,1138,3,1,1204,3,1,1352,3,1,1,3,1,1013,3,1,1013,7,1
DW 1013,7,1,1138,7,1
DW 903,31,1
DW 1352,3,1,1352,3,1,1204,3,1,1138,3,1,1013,3,1,1138,3,1,1204,3,1,1352,3,1
DW 1,3,1,1204,7,1,1518,3,1,1352,23,1
DW 1,3,1,1352,3,1,1204,3,1,1138,3,1
DW 1013,3,1,1138,3,1,1204,3,1,1352,3,1,1,3,1,1013,7,1,1138,3,1
DW 903,31,1
DW 1,3,1,852,2,1,852,5,1,903,3,1,903,3,1,1013,3,1,1013,2,1,2275,3,1
DW 1,3,1,1013,2,1,1138,2,1,1013,2,1,1138,3,1,903,7,1,1013,2,1,1138,3,1
DW 1352,63,1
DW 65535
; The following is for GPSCR
; 0:main 1:int_1c 2:int9
; 3:int_B 4:int_C
;===================================
begin_x DB 5 DUP (?)
begin_y DB 5 DUP (?)
end_x DB 5 DUP (?)
end_y DB 5 DUP (?)
gp_mode DB 5 DUP (?)
; The following is for running words
;===================================
run_word_ptr DW 0
run_word_strptr DW 0
run_word_count DB 0
run_word_str DB 40 DUP (?)
run_word DB 'T',81,'h',81,'i',81,'s',81,' ',81,'P',81,'r',81,'o',81
DB 'g',81,'r',81,'a',81,'m',81,' ',81,'i',81,'s',81,' ',81
DB 'h',81,'o',81,'m',81,'e',81,'w',81,'o',81,'r',81,'k',81
DB ' ',81,'o',81,'f',81,' ',81,'M',81,'i',81,'c',81,'r',81
DB 'o',81,'C',81,'o',81,'m',81,'p',81,'u',81,'t',81,'e',81
DB 'r',81,'.',81,' ',81,'T',81,'h',81,'e',81,' ',81,'t',81
DB 'i',81,'t',81,'l',81,'e',81,' ',81,'o',81,'f',81,' ',81
DB 'L',81,'A',81,'B',81,'4',81,' ',81,'i',81,'s',81,' ',81
DB 'A',81,'s',81,'y',81,'n',81,'c',81,'h',81,'r',81,'o',81
DB 'n',81,'o',81,'u',81,'s',81,'_',81,'S',81,'e',81,'r',81
DB 'i',81,'a',81,'l',81,'_',81,'C',81,'o',81,'m',81,'m',81
DB 'u',81,'n',81,'i',81,'c',81,'a',81,'t',81,'i',81,'o',81
DB 'n',81,'.',81,' ',81,'I',81,'t',81,' ',81,'i',81,'s',81
DB ' ',81,'w',81,'r',81,'i',81,'t',81,'t',81,'e',81,'n',81
DB ' ',81,'b',81,'y',81,' ',81,'Y',81,'u',81,'n',81,'g',81
DB '-',81,'y',81,'i',81,' ',81,'L',81,'e',81,'e',81,',',81
DB ' ',81,'N',81,'C',81,'U',81,' ',81,'M',81,'E',81,'.',81
DB ' ',81,'[',81,'å',94,'ç',94,' ',94,'ê',94,'ë',94,' ',94
DB ':',94,' ',94,'Ç',94,'ü',94,' ',94,'é',94,'â',94,' ',94
DB 'ä',94,'à',94,']',81,' ',81,'[',81,'è',95,'ï',95,' ',95
DB 'å',95,'ç',95,' ',95,':',95,' ',95,'ÿ',95,'Ö',95,' ',95
DB 'Ü',95,'¢',95,' ',95,'£',95,'¥',95,']',81,' ',81,'[',81
DB 'î',91,'ì',91,' ',91,'Ä',91,'Å',91,' ',91,'É',91,'æ',91
DB ' ',91,'Æ',91,'ô',91,' ',91,'ö',91,'ò',91,' ',91,'û',91
DB 'ù',91,']',81,' ',81
; The following is for int_1c
;===================================
time_tmp DB 2 DUP (?)
time_str DB ?,31,?,31,':',31,?,31,?,31,':',31,?,31,?,31
mydst_pmt DB ' ',13,10,'Your Workstation Number is : $'
keymap DB ' ',7,'1234567890-=',6,'QWERTYUIOP[]',5,'ASDFGHJKL;'
DB 39,'`\ZXCVBNM,./* ',1,2,3,4
; The following is for send/rcv area
;===================================
bar DB '\',13,'-',11,'/',14,'|',10 ;Bar Char.
cls DB 72 DUP (' ',14) ;Char.s for CLS
askdst_mode DB 0h ;If asking destination
send_x DB 2h ;X-coordernate of SEND
send_y DB 2h ;Y-coordernate of SEND
rcv_x DB 3h ;X-coordernate of RCV
rcv_y DB 0ah ;Y-coordernate of RCV
char DB ?,14 ;Char on Screen
space DB ' ',14 ;Space char.
recording DB 0h ;Recording Flag
dst DB 0h ;Destination
mydst DB 1h ;Your Station No.
mychk DB 0h ;Your CHK
chk DB 0h ;Send_CHK
msg_ctr DB 0h ;Send MSG Counter
msg_ptr DW 0h ;Send MSG Pointer
msg_len DB 0h ;Send MSG Length
rcv_bar DB 0h ;RCV Bar No.
rcv_ptr DW 0h ;RCV MSG Pointer
rcv_len DB 0h ;RCV MSG Length
rcv_msg DB 144 DUP (?) ;RCV MSG Buffer
rcv_char DB ?,14 ;RCV char. on Screen
send_msg DB 72 DUP (?) ;Send MSG Buffer
send_bar DB 0h ;SEND Bar No.
send_self DB 0h ;Send_Self Flag
newc_state DW 0h ;RCV ISR State
newc_1st DB 1h ;1st RCV ISR Flag
dsp_ctr DB 0h ;DSPRCV Counter
sleep DB 0h ;Sleep Flag
sleep_ctr DW 0h ;Sleep Counter
;-------------------------------------------------------------------------------
; NEW_B : New 0Bh ISR (COM2:Sender)
;-------------------------------------------------------------------------------
NEW_B PROC NEAR
cli
push ax
push bx
push cx
push dx
push ds
push si
mov cx, @code ;Show rotating bar
mov ds, cx
xor bh, bh
mov bl, CS:SEND_BAR
shl bl, 1h
lea si, CS:BAR[bx]
mov ax, 0601h
mov dx, ax
mov ch, PUT_MODE
mov cl, 3h
call GPSCR
inc CS:SEND_BAR
cmp CS:SEND_BAR, 4h
jl newb_again
mov CS:SEND_BAR, 0h
newb_again: mov dx, 2fdh ;Test if SEND_PORT
in al, dx ; is empty !
test al, 01100000b
jz newb_again
mov al, 20h ;Send EOI
out 20h, al
pop si
pop ds
pop dx
pop cx
pop bx
pop ax
sti
iret
NEW_B ENDP
;-------------------------------------------------------------------------------
; NEW_C : New 0Ch ISR (COM1:Receiver)
;-------------------------------------------------------------------------------
NEW_C PROC NEAR
cli
push ax
push bx
push cx
push dx
push ds
push si
mov cx, @code ;Show rotating bar
mov ds, cx
xor bh, bh
mov bl, CS:RCV_BAR
shl bl, 1h
lea si, CS:BAR[bx]
mov ax, 0609h
mov dx, ax
mov ch, PUT_MODE
mov cl, 4h
call GPSCR
inc CS:RCV_BAR
cmp CS:RCV_BAR, 4h
jl newc_begin
mov CS:RCV_BAR, 0h
newc_begin: cmp CS:NEWC_1ST, YES ;If 1st startup
jne newc_begin1
mov CS:NEWC_1ST, NO
mov CS:NEWC_STATE, OFFSET cs:state_0r
mov dx, RCV_PORT
in al, dx
mov al, ETX
jmp newc_exit
newc_begin1: mov dx, RCV_PORT
in al, dx
jmp WORD PTR CS:NEWC_STATE
state_0r: cmp al, ETX
je st_0r1
cmp al, SOH
jne newc_exit
mov CS:NEWC_STATE, OFFSET cs:state_1d
jmp newc_exit
st_0r1: cmp CS:DST, NULL
je newc_exit
mov al, SOH
mov CS:NEWC_STATE, OFFSET cs:state_0m
jmp newc_exit
state_1d: cmp al, CS:MYDST
je st_1d1
mov CS:NEWC_STATE, OFFSET cs:state_0r
jmp newc_exit
st_1d1: mov CS:RCV_PTR, OFFSET CS:RCV_MSG
mov CS:NEWC_STATE, OFFSET cs:state_2d
jmp newc_exit
state_2d: cmp al, DLE
je st_2d1
mov al, CAN
mov CS:NEWC_STATE, OFFSET cs:state_0r
jmp newc_exit
st_2d1: mov CS:NEWC_STATE, OFFSET cs:state_3d
jmp newc_exit
state_3d: cmp al, 144
jbe st_3d1
mov al, CAN
mov CS:NEWC_STATE, OFFSET cs:state_0r
jmp newc_exit
st_3d1: mov CS:RCV_LEN, al
mov CS:MSG_CTR, al
mov cl, CS:MYDST
mov CS:MYCHK, cl
add CS:MYCHK, al
add CS:MYCHK, DLE
st_3d3: cmp CS:MSG_CTR, 0h
je st_3d2
mov CS:NEWC_STATE, OFFSET cs:state_4d
jmp newc_exit
st_3d2: mov CS:NEWC_STATE, OFFSET cs:state_5d
jmp newc_exit
state_4d: cmp al, CAN
je st_4d1
dec CS:MSG_CTR
add CS:MYCHK, al
mov si, CS:RCV_PTR
mov [si], al
inc CS:RCV_PTR
jmp st_3d3
st_4d1: mov CS:NEWC_STATE, OFFSET cs:state_0r
jmp newc_exit
state_5d: cmp al, ETB
je st_5d1
mov al, CAN
mov CS:NEWC_STATE, OFFSET cs:state_0r
jmp newc_exit
st_5d1: mov CS:NEWC_STATE, OFFSET cs:state_6d
jmp newc_exit
state_6d: cmp al, DLE
je st_6d1
mov al, CAN
mov CS:NEWC_STATE, OFFSET cs:state_0r
jmp newc_exit
st_6d1: mov CS:NEWC_STATE, OFFSET cs:state_7d
jmp newc_exit
state_7d: cmp al, CS:MYCHK
je st_7d1
mov al, NAK
mov CS:NEWC_STATE, OFFSET cs:state_0r
jmp newc_exit
st_7d1: call DSPRCV
mov al, ACK
mov CS:NEWC_STATE, OFFSET cs:state_0r
jmp newc_exit
state_0m: cmp al, SOH
je st_0m1
mov al, CAN
mov CS:NEWC_STATE, OFFSET cs:state_em
jmp newc_exit
st_0m1: mov CS:MSG_PTR, OFFSET CS:SEND_MSG
mov al, CS:DST
mov CS:NEWC_STATE, OFFSET cs:state_1m
jmp newc_exit
state_em: cmp al, CAN
je st_em1
mov al, CAN
jmp newc_exit
st_em1: mov al, SOH
mov CS:NEWC_STATE, OFFSET cs:state_0m
jmp newc_exit
state_1m: cmp al, CS:DST
je st_1m1
mov al, CAN
mov CS:NEWC_STATE, OFFSET cs:state_em
jmp newc_exit
st_1m1: cmp al, CS:MYDST
jne st_1m2
mov CS:SEND_SELF, YES
mov CS:RCV_PTR, OFFSET CS:RCV_MSG
st_1m2: mov al, DLE
mov CS:NEWC_STATE, OFFSET cs:state_2m
jmp newc_exit
state_2m: cmp al, DLE
je st_2m1
mov al, CAN
mov CS:NEWC_STATE, OFFSET cs:state_em
jmp newc_exit
st_2m1: mov al, CS:MSG_LEN
mov CS:NEWC_STATE, OFFSET cs:state_3m
jmp newc_exit
state_3m: cmp al, CS:MSG_LEN
je st_3m1
mov al, CAN
mov CS:NEWC_STATE, OFFSET cs:state_em
jmp newc_exit
st_3m1: mov CS:MSG_CTR, al
cmp CS:SEND_SELF, YES
je st_3m2
mov cl, CS:DST
mov CS:CHK, cl
add CS:CHK, al
add CS:CHK, DLE
je st_3m3
st_3m2: mov CS:RCV_LEN, al
mov cl, CS:DST
mov CS:MYCHK, cl
add CS:MYCHK, al
add CS:MYCHK, DLE
st_3m3: cmp CS:MSG_CTR, 0h
je st_3m4
mov si, CS:MSG_PTR
mov al, BYTE PTR [si]
cmp al, '*'
jne st_3m5
add CS:CHK, 5h
add CS:MYCHK, 5h
mov cl, '/'
mov [si], cl
st_3m5: mov CS:NEWC_STATE, OFFSET cs:state_4m
jmp newc_exit
st_3m4: mov al, ETB
mov CS:NEWC_STATE, OFFSET cs:state_5m
jmp newc_exit
state_4m: mov si, CS:MSG_PTR
cmp al, [si]
je st_4m1
mov al, CAN
mov CS:NEWC_STATE, OFFSET cs:state_em
jmp newc_exit
st_4m1: dec CS:MSG_CTR
cmp CS:SEND_SELF, YES
je st_4m2
add CS:CHK, al
inc CS:MSG_PTR
jmp st_3m3
st_4m2: add CS:MYCHK, al
mov si, CS:RCV_PTR
mov [si], al
inc CS:RCV_PTR
inc CS:MSG_PTR
jmp st_3m3
state_5m: cmp al, ETB
je st_5m1
mov al, CAN
mov CS:NEWC_STATE, OFFSET cs:state_em
jmp newc_exit
st_5m1: mov al, DLE
mov CS:NEWC_STATE, OFFSET cs:state_6m
jmp newc_exit
state_6m: cmp al, DLE
je st_6m1
mov al, CAN
mov CS:NEWC_STATE, OFFSET cs:state_em
jmp newc_exit
st_6m1: mov al, CS:CHK
cmp CS:SEND_SELF, YES
jne st_6m2
mov al, CS:MYCHK
st_6m2: mov CS:NEWC_STATE, OFFSET cs:state_7m
jmp newc_exit
state_7m: cmp CS:SEND_SELF, YES
je st_7m1
cmp al, ACK
je st_7m2
cmp al, CS:CHK
je st_7m4
mov al, CAN
mov CS:NEWC_STATE, OFFSET cs:state_em
jmp newc_exit
st_7m2: mov CS:DST, NULL
mov al, ETX
mov CS:NEWC_STATE, OFFSET cs:state_0r
jmp newc_exit
st_7m1: cmp al, CS:MYCHK
je st_7m3
mov al, CAN
mov CS:NEWC_STATE, OFFSET cs:state_em
jmp newc_exit
st_7m3: call DSPRCV
mov CS:DST, NULL
mov CS:SEND_SELF, NO
mov al, ETX
mov CS:NEWC_STATE, OFFSET cs:state_0r
jmp newc_exit
st_7m4: mov ah, 2h
mov dl, 7h
int 21h
jmp st_7m2
newc_exit: mov dx, SEND_PORT ;Send data to COM2
out dx, al
mov al, 20h ;Send EOI
out 20h, al
pop si
pop ds
pop dx
pop cx
pop bx
pop ax
sti
iret
NEW_C ENDP
;-------------------------------------------------------------------------------
; DSPRCV : Display receive message
;-------------------------------------------------------------------------------
DSPRCV PROC NEAR
push ax
push bx
push cx
push dx
push ds
push si
mov CS:SLEEP, NO
mov CS:SLEEP_CTR, 0h
xor bx, bx
mov CS:DSP_CTR, 0h
dsp_cls: mov cx, @code ;Clear Current Line
mov ds, cx
mov si, OFFSET CS:CLS
mov ah, CS:RCV_X
mov al, CS:RCV_Y
mov dx, ax
add dx, 4700h
mov ch, PUT_MODE
mov cl, 4h
call GPSCR
dsp_begin: mov cl, CS:RCV_MSG[bx] ;Display Message
mov CS:RCV_CHAR, cl
mov cx, @code
mov ds, cx
mov si, OFFSET CS:RCV_CHAR
mov al, CS:RCV_Y
mov ah, CS:RCV_X
mov dx, ax
mov ch, PUT_MODE
mov cl, 4h
call GPSCR
inc bx
cmp bl, CS:RCV_LEN
je dsp_exit
inc CS:RCV_X
inc CS:DSP_CTR
cmp CS:DSP_CTR, 72
jl dsp_begin
mov CS:DSP_CTR, 0h
mov CS:RCV_X, 3h
inc CS:RCV_Y
cmp CS:RCV_Y, 17
jl dsp_cls
mov CS:RCV_Y, 0ah
jmp dsp_cls
dsp_exit: mov CS:RCV_X, 3h
inc CS:RCV_Y
cmp CS:RCV_Y, 17
jl dsp_exit1
mov CS:RCV_Y, 0ah
dsp_exit1: pop si
pop ds
pop dx
pop cx
pop bx
pop ax
ret
DSPRCV ENDP
;------------------------------------------------------------------------------
; NEW_9 : New 9h ISR
;------------------------------------------------------------------------------
NEW_9 PROC NEAR
push ax
push bx
push cx
push dx
push ds
push si
sti
mov CS:SLEEP, NO
mov CS:SLEEP_CTR, 0h
mov al, 20h ;Send EOI
out 20h, al
in al, 60h ;Get KB Char.
test al, 80h
jnz new9_exit
push cs
pop ds
lea bx, CS:KEYMAP
xlatb
cmp al, NOTHING
je new9_exit
cmp CS:ASKDST_MODE, YES
jne new9_case
cmp al, '0'
jl new9_exit
cmp al, '7'
jg new9_exit
mov CS:DST, al
mov CS:ASKDST_MODE, NO
call ASKDST
jmp new9_exit
new9_case: cmp al, F2
je new9_1
cmp al, ESCAPE
je new9_2
cmp al, RETURN
je new9_3
cmp al, F1
je new9_4
cmp al, F3
je new9_5
cmp al, F4
je new9_6
cmp al, BACK
jne new9_def
new9_7: cmp CS:RECORDING, YES ; BACKSPACE
jne back1 ;=============
cmp CS:MSG_LEN, 0h
je back1
dec CS:MSG_LEN
back1: cmp CS:SEND_X, 3h
jl new9_exit
mov cx, @code ;Clear old char.
mov ds, cx ; ⌠ BEGIN
mov si, OFFSET CS:SPACE ; │
mov ah, CS:SEND_X ; │
mov al, CS:SEND_Y ; │
mov dx, ax ; │
push dx ; │
mov ch, PUT_MODE ; │
mov cl, 2h ; │
call GPSCR ; ⌡ END
pop dx ;Set new cursor
xchg dl, dh ; ⌠ BEGIN
mov bh, 0h ; │
mov ah, 2h ; │
int 10h ; │
dec CS:SEND_X ; ⌡ END
jmp new9_exit
new9_1: inc CS:SONG_PTR ; MUSIC SWITCH
cmp CS:SONG_PTR, 5h ;================
jl song1 ;Show current song No.
mov cx, 0 ; ⌠ BEGIN
mov CS:SONG_PTR, cx ; │
song1: mov bx, CS:SONG_PTR ; │
mov dl, CS:SONG_INDEX[bx] ; │
mov CS:SONG_SIGN, dl ; │
mov cx, @code ; │
mov ds, cx ; │
mov si, OFFSET CS:SONG_SIGN ; │
mov ax, 1418h ; │
mov dx, 1418h ; │
mov ch, PUT_MODE ; │
mov cl, 2h ; │
call GPSCR ; ⌡ END
cmp CS:SONG_PTR, 0h ;(no song)? turn_off:a4
jne song2 ;Turn off spacker
mov CS:SONG_FLAG, NO ; ⌠ BEGIN
mov CS:SONG_COUNTER, 0h ; │
in al, SOUND_SWITCH ; │
and al, 11111100b ; │
out SOUND_SWITCH, al ; │
jmp new9_exit ; ⌡ END
song2: mov CS:SONG_FLAG, NO ;LABEL: song2
in al, SOUND_SWITCH ;Turn on the speaker &
and al, 11111100b ;Set up new song handle
out SOUND_SWITCH, al ; ⌠ BEGIN
mov al, 0b6h ; │
out SOUND_CONTROL, al ; │
mov ax, CS:SONG_PTR ; │
mov bx, ax ; │
shl bx, 1 ; │
mov cx, CS:SONG_ADDR[bx] ; │
mov CS:SONG_POINTER, cx ; │
mov si, CS:SONG_POINTER ; │
mov cx, CS:[si] ; │
mov CS:SONG_FREQUENCY, cx ; │
add CS:SONG_POINTER, 2h ; │
mov si, CS:SONG_POINTER ; │
mov cx, CS:[si] ; │
mov CS:SONG_TICK, cx ; │
mov ax, CS:SONG_FREQUENCY ; │
out SOUND_PORT, al ; │
mov al, ah ; │
out SOUND_PORT, al ; │
in al, SOUND_SWITCH ; │
or al, 3h ; │
out SOUND_SWITCH, al ; │
mov CS:SONG_COUNTER, 0h ; │
mov CS:SONG_STATE, YES ; │
mov CS:SONG_FLAG, YES ; ⌡ END
jmp new9_exit
new9_2: cli ; ESCAPE
call SHUTDOWN ;==========
pop si ;Pop register &
pop ds ; ⌠ BEGIN
pop dx ; │
pop cx ; │
pop bx ; │
pop ax ; ⌡ END
mov ah, 4ch ;Exit program
int 21h ;
new9_3: mov CS:SEND_X, 2h ; RETURN
inc CS:SEND_Y ;==========
cmp CS:SEND_Y, 8h ;Set new cursor
jle ent1 ; ⌠ BEGIN
mov CS:SEND_Y, 2h ; │
ent1: mov dl, CS:SEND_X ; │
mov dh, CS:SEND_Y ; │
add dx, 1h ; │
push dx ; │
mov bh, 0h ; │
mov ah, 2h ; │
int 10h ; ⌡ END
mov cx, @code ;Clear Next Line
mov ds, cx ; ⌠ BEGIN
mov si, OFFSET CS:CLS ; │
pop ax ; │
xchg al, ah ; │
mov dx, ax ; │
add dx, 4700h ; │
mov ch, PUT_MODE ; │
mov cl, 2h ; │
call GPSCR ; ⌡ END
cmp CS:RECORDING, YES ;(record send_msg)? /
jne new9_exit ; end_record:new9_exit
mov CS:RECORDING, NO ;End recording
mov CS:CHAR+1, 14 ; ⌠ BEGIN
mov CS:ASKDST_MODE, YES ; │
call ASKDST ; ⌡ END
jmp new9_exit
new9_4: cmp CS:RECORDING, YES ; F1
je new9_exit ;======
cmp CS:DST, NULL
jne new9_exit
mov CS:RECORDING, YES
mov CS:MSG_LEN, 0h
mov CS:CHAR+1, 10
mov CS:SEND_X, 2h
inc CS:SEND_Y
cmp CS:SEND_Y, 8h
jle f11
mov CS:SEND_Y, 2h
f11: mov dl, CS:SEND_X
mov dh, CS:SEND_Y
add dx, 1h
push dx
mov bh, 0h
mov ah, 2h
int 10h
mov cx, @code
mov ds, cx
mov si, OFFSET CS:CLS
pop ax
xchg al, ah
mov dx, ax
add dx, 4700h
mov ch, PUT_MODE
mov cl, 2h
call GPSCR
jmp new9_exit
new9_5: cmp CS:RECORDING, YES ; F3
je new9_exit ;======
mov dx, 0202h
mov CS:SEND_X, dl
mov CS:SEND_Y, dh
add dx, 1h
mov bh, 0h
mov ah, 2h
int 10h
mov bx, 0h
f31: cmp bx, 7h
je new9_exit
mov cx, @code
mov ds, cx
mov si, OFFSET CS:CLS
mov ax, 0302h
add ax, bx
mov dx, ax
add dx, 4700h
mov ch, PUT_MODE
mov cl, 2h
call GPSCR
inc bx
loop f31
new9_6: mov bx, 0h ; F4
mov CS:RCV_X, 3h ;======
mov CS:RCV_Y, 0ah
f41: cmp bx, 7h
je new9_exit
mov cx, @code
mov ds, cx
mov si, OFFSET CS:CLS
mov ax, 030ah
add ax, bx
mov dx, ax
add dx, 4700h
mov ch, PUT_MODE
mov cl, 2h
call GPSCR
inc bx
loop f41
new9_def: cmp CS:RECORDING, YES ; Default Keyin
jne def1 ;=================
cmp CS:MSG_LEN, 72
je def4
inc CS:MSG_LEN
def4: xor bh, bh
mov bl, CS:MSG_LEN
dec bx
mov CS:SEND_MSG[bx], al
def1: inc CS:SEND_X
cmp CS:SEND_X, 74
jle def2
cmp CS:RECORDING, YES
je def3
mov CS:SEND_X, 3h
inc CS:SEND_Y
cmp CS:SEND_Y, 8h
jle def2
mov CS:SEND_Y, 2h
jmp def2
def3: mov CS:SEND_X, 74
def2: mov CS:CHAR, al
mov cx, @code
mov ds, cx
mov si, OFFSET CS:CHAR
mov ch, PUT_MODE
mov cl, 2h
mov ah, CS:SEND_X
mov al, CS:SEND_Y
mov dx, ax
call GPSCR
mov dl, CS:SEND_X
mov dh, CS:SEND_Y
add dx, 1h
mov bh, 0h
mov ah, 2h
int 10h
jmp new9_exit
new9_exit: pop si
pop ds
pop dx
pop cx
pop bx
pop ax
iret
NEW_9 ENDP
;-------------------------------------------------------------------------------
; ASKDST : Ask for message destination
;-------------------------------------------------------------------------------
ASKDST PROC NEAR
push cx
push es
push di
push ax
mov cx, CS:VIDEO_BASE
mov es, cx
mov di, 3269
mov cx, 11
cmp CS:ASKDST_MODE, YES
jne askdst_loop2
askdst_loop1: mov al, 159 ;Prompt for DST
stosb ; ⌠ BEGIN
inc di ; │
loop askdst_loop1 ; │
mov al, 31 ; │
mov di, 3438 ; │
mov al, ' ' ; │
stosb ; ⌡ END
jmp askdst_exit
askdst_loop2: mov al, 31 ;Restore prompt
stosb ; ⌠ BEGIN
inc di ; │
loop askdst_loop2 ; │
mov di, 3438 ; │
pop ax ; │
push ax ; │
stosb ; ⌡ END
askdst_exit: pop ax
pop di
pop es
pop cx
ret
ASKDST ENDP
;------------------------------------------------------------------------------
; NEW_1C : New 1ch ISR
;------------------------------------------------------------------------------
NEW_1C PROC NEAR
sti
push ax
call RUNNING
call TIME
call MUSIC
inc CS:SLEEP_CTR
cmp CS:SLEEP, YES
je new1c_sleep
cmp CS:SLEEP_CTR, 364
jne new1c_nosleep
mov CS:SLEEP, YES
mov CS:SLEEP_CTR, 0h
new1c_sleep: mov al, 1h
mov ah, 5h
int 10h
jmp new1c_exit
new1c_nosleep: mov al, 0h
mov ah, 5h
int 10h
jmp new1c_exit
new1c_exit: pop ax
iret
NEW_1C ENDP
;------------------------------------------------------------------------------
; MUSIC : Manage music
;------------------------------------------------------------------------------
MUSIC PROC NEAR
pushf
push ax
push si
cmp CS:SONG_FLAG, YES
jne music_exit
mov ax, CS:SONG_TICK
cmp CS:SONG_COUNTER, ax
je mu1
inc CS:SONG_COUNTER
jmp music_exit
mu1: mov CS:SONG_COUNTER, 0h
cmp CS:SONG_STATE, YES
jne speakeron
mov CS:SONG_STATE, NO
add CS:SONG_POINTER, 2h
mov si, CS:SONG_POINTER
mov ax, CS:[si]
mov CS:SONG_TICK, ax
in al, SOUND_SWITCH
and al, 11111100b
out SOUND_SWITCH, al
jmp music_exit
speakeron: mov CS:SONG_STATE, YES
add CS:SONG_POINTER, 2h
mov si, CS:SONG_POINTER
mov ax, CS:[si]
mov CS:SONG_FREQUENCY, ax
cmp CS:SONG_FREQUENCY, 65535
jne continue
in al, SOUND_SWITCH
and al, 11111100b
out SOUND_SWITCH, al
mov CS:SONG_FLAG, NO
jne music_exit
continue: add CS:SONG_POINTER, 2h
mov si, CS:SONG_POINTER
mov ax, CS:[si]
mov CS:SONG_TICK, ax
mov ax, CS:SONG_FREQUENCY
out SOUND_PORT, al
mov al, ah
out SOUND_PORT, al
in al, SOUND_SWITCH
or al, 3h
out SOUND_SWITCH, al
music_exit: cmp CS:SONG_FREQUENCY, 1h
jne music_bye
in al, SOUND_SWITCH
and al, 11111100b
out SOUND_SWITCH, al
music_bye: pop si
pop ax
popf
ret
MUSIC ENDP
;------------------------------------------------------------------------------
; TIME : Show current time
;------------------------------------------------------------------------------
TIME PROC NEAR
pushf
push ax
push cx
push dx
push ds
push si
push es
push di
mov ax, @code
mov es, ax
mov ds, ax
mov ah, 2ch
int 21h
xor ah, ah
mov al, dh
push ax
mov al, cl
push ax
mov al, ch
push ax
mov cx, 3
trans_again: mov ax, OFFSET TIME_TMP
mov si, ax
mov di, ax
pop ax
xchg al, ah
call B2A
mov dx, cx
mov ax, 3
sub ax, dx
mov dx, 6
mul dx
mov dx, OFFSET TIME_STR
add dx, ax
mov di, dx
movsb
inc di
movsb
dec cx
cmp cx, 0h
jg trans_again
lea si, TIME_STR
mov ax, 1215h ;ax=(18,21)
mov dx, 1915h ;dh=(25,21)
mov ch, PUT_MODE
mov cl, 1h
call GPSCR
pop di
pop es
pop si
pop ds
pop dx
pop cx
pop ax
popf
ret
TIME ENDP
;------------------------------------------------------------------------------
; B2A : Binary to ASCII
; Output> es:di(ascii string) , input> es:di->buffer ah=binary
;------------------------------------------------------------------------------
B2A PROC NEAR
pushf
push ax
push bx
push cx
cld
cmp ah, 9h ;if ah >= 9
jg begin ; goto begin
mov al, '0' ;else
stosb ; es:di[0]='0'
begin: mov bl, 0ah ;initialization
mov cx, 0h
mov al, ah
xor ah, ah
again: div bl ;al/bl (al=quo,ah=rem)
cmp ax, 0h ;if ax=0
je done ; goto done
add ah, 30h ;convert num. to char.
push ax
inc cx
xor ah, ah
jmp again
done: cmp cx, 0h
je zero_case
normal_case: pop ax
mov al, ah
stosb
loop normal_case
jmp ok
zero_case: mov al, '0'
stosb
ok: pop cx
pop bx
pop ax
popf
ret
B2A ENDP
;------------------------------------------------------------------------------
; RUNNING : Show running words
;------------------------------------------------------------------------------
RUNNING PROC NEAR
pushf
push ax
push cx
push dx
push ds
push si
push es
push di
mov ax, @code
mov ds, ax
mov es, ax
inc CS:RUN_WORD_COUNT
cmp CS:RUN_WORD_COUNT, 3 ;Judge speed
jne exit_run
mov CS:RUN_WORD_COUNT, 0
cmp CS:RUN_WORD_STRPTR, 389 ;If EOL
jl begin_run
mov CS:RUN_WORD_STRPTR, 0
begin_run: push CS:RUN_WORD_STRPTR
pop CS:RUN_WORD_PTR
add CS:RUN_WORD_STRPTR, 2
lea di, CS:RUN_WORD_STR
mov cx, 20
run_loop: cmp CS:RUN_WORD_PTR, 389 ;If EOL
jl run1
mov CS:RUN_WORD_PTR, 0
run1: lea si, CS:RUN_WORD
add si, CS:RUN_WORD_PTR
movsw
add CS:RUN_WORD_PTR, 2
loop run_loop
lea si, CS:RUN_WORD_STR
mov ax, 3918h ;ax=(57,24)
mov dx, 4c18h ;dh=(76,24)
mov ch, PUT_MODE
mov cl, 1h
call GPSCR
exit_run: pop di
pop es
pop si
pop ds
pop dx
pop cx
pop ax
popf
ret
RUNNING ENDP
;------------------------------------------------------------------------------
; VIDEO : Get text video address base
;------------------------------------------------------------------------------
VIDEO PROC NEAR
pushf
push ax
push bx
push ds
mov ah, 0fh ;Get video mode
int 10h
cmp al, 7h
je mode_7
cmp al, 3h
je mode_3
mov ah, 4ch
int 21h
mov ax, @data
mov ds, ax
mode_3: mov CS:VIDEO_BASE, 0b800h
jmp exit_video
mode_7: mov CS:VIDEO_BASE, 0b000h
exit_video: pop ds
pop bx
pop ax
popf
ret
VIDEO ENDP
;-------------------------------------------------------------------------------
; XY2MEM : Transfer xy to mem
; output> ax , input> ax=(x,y)
;-------------------------------------------------------------------------------
XY2MEM PROC NEAR
pushf
push bx
push dx
mov bx, ax
mov bl, 80
mul bl ;ax=al*bl [ax=y*80]
mov bl, bh
xor bh, bh
add ax, bx ;ax=ax+bx [ax=80y+x]
mov bl, 2h
mul bx ;dx:ax=ax*2
pop dx
pop bx
popf
ret
XY2MEM ENDP
;-------------------------------------------------------------------------------
; GPSCR : Get/Put block data from/to screen
; input> ax=(begin_x,begin_y) dx=(end_x,end_y)
; ch=0(GET) ch=1(PUT) cl=data_group( 1, 2, 3 )
; (GET) es:di->(word)buffer
; (PUT) ds:si->(word)string
;-------------------------------------------------------------------------------
GPSCR PROC NEAR
pushf
push bx
push ds
push si
push es
push di
cld
mov bl, cl
xor bh, bh
mov CS:GP_MODE[bx], ch
mov CS:BEGIN_X[bx], ah
mov CS:BEGIN_Y[bx], al
mov CS:END_X[bx], dh
mov CS:END_Y[bx], dl
mov cx, ax ;Initialize couter
push CS:VIDEO_BASE
cmp CS:GP_MODE[bx], GET_MODE ;What mode ?
je get
pop es ;put_mode
call XY2MEM ; es:di->screen
mov di, ax
jmp if_eol
get: pop ds ;get_mode
call XY2MEM ; ds:si->screen
mov si, ax
if_eol: cmp ch, CS:END_X[bx] ;if end of line
jle if_end
mov ch, CS:BEGIN_X[bx] ; end of line
inc cl
inc CS:BEGIN_Y[bx]
mov ah, CS:BEGIN_X[bx]
mov al, CS:BEGIN_Y[bx]
call XY2MEM
cmp CS:GP_MODE[bx], PUT_MODE
je put
mov si, ax
jmp if_end
put: mov di, ax
if_end: cmp cl, CS:END_Y[bx]
jg exit_gp
getscr: movsw
inc ch
jmp if_eol
exit_gp: pop di
pop es
pop si
pop ds
pop bx
popf
ret
GPSCR ENDP
;-------------------------------------------------------------------------------
; STARTUP
;-------------------------------------------------------------------------------
STARTUP MACRO
LOCAL reget
mov dx, @code ;Prompt your destination
mov ds, dx
mov dx, OFFSET CS:MYDST_PMT+2
mov ah, 9h
int 21h
reget: mov ah, 7h
int 21h
cmp al, '7'
jg reget
cmp al, '0'
jl reget
mov CS:MYDST, al
call VIDEO ;Detect video mode
mov ax, 1010h ;Change palete
mov bh, 0h
mov ch, 10h
mov cl, 095h
mov dh, 80h
int 10h
mov dx, @data ;Change font
mov es, dx
mov bp, OFFSET FONT
mov ah, 11h
mov al, 10h
mov bx, 1000h
mov cx, 7eh
mov dx, 20h
int 10h
mov dx, @data ;Draw main screen
mov ds, dx
mov si, OFFSET MAIN_SCR
mov ax, 0h
mov dx, 4f18h
mov ch, PUT_MODE
mov cl, 0h
call GPSCR
mov es, CS:VIDEO_BASE ;Show your destination
mov di, 0c0h
mov al, CS:MYDST
stosb
mov dx, 0203h ;Place cursor
mov bh, 0h
mov ah, 2h
int 10h
mov dx, 2fbh ;Initialize COM2
mov al, 80h
out dx, al
mov dx, 2f8h
mov al, 0ch
out dx, al
mov dx, 2f9h
mov al, 0h
out dx, al
mov dx, 2fbh
mov al, 3h
out dx, al
mov dx, 2f9h
mov al, 2h
out dx, al
mov dx, 2fch
mov al, 8h
out dx, al
mov dx, 3fbh ;Initialize COM1
mov al, 80h
out dx, al
mov dx, 3f8h
mov al, 0ch
out dx, al
mov dx, 3f9h
mov al, 0h
out dx, al
mov dx, 3fbh
mov al, 3h
out dx, al
mov dx, 3f9h
mov al, 1h
out dx, al
mov dx, 3fch
mov al, 8h
out dx, al
mov ax, 351ch ;Change INT 1C
int 21h
mov CS:OLD_1C_SEG, es
mov CS:OLD_1C_OFF, bx
mov dx, @code
mov ds, dx
mov dx, OFFSET CS:NEW_1C
mov ax, 251ch
int 21h
mov ax, 3509h ;Change INT 9
int 21h
mov CS:OLD_9_SEG, es
mov CS:OLD_9_OFF, bx
mov dx, @code
mov ds, dx
mov dx, OFFSET CS:NEW_9
mov ax, 2509h
int 21h
mov ax, 350bh ;Change INT B
int 21h
mov CS:OLD_B_SEG, es
mov CS:OLD_B_OFF, bx
mov dx, @code
mov ds, dx
mov dx, OFFSET CS:NEW_B
mov ax, 250bh
int 21h
mov ax, 350ch ;Change INT C
int 21h
mov CS:OLD_C_SEG, es
mov CS:OLD_C_OFF, bx
mov dx, @code
mov ds, dx
mov dx, OFFSET CS:NEW_C
mov ax, 250ch
int 21h
in al, PICIMR ;Enable COM1 COM2
and al, 11100111b
out PICIMR, al
int 0ch
ENDM
;-------------------------------------------------------------------------------
; SHUTDOWN
;-------------------------------------------------------------------------------
SHUTDOWN PROC NEAR
cli
push ax
push dx
push ds
push si
mov ds, CS:OLD_1C_SEG ;Restore INT 1C
mov dx, CS:OLD_1C_OFF
mov ax, 251ch
int 21h
mov ds, CS:OLD_9_SEG ;Restore INT 9
mov dx, CS:OLD_9_OFF
mov ax, 2509h
int 21h
mov ds, CS:OLD_B_SEG ;Restore INT B
mov dx, CS:OLD_B_OFF
mov ax, 250bh
int 21h
mov ds, CS:OLD_C_SEG ;Restore INT C
mov dx, CS:OLD_C_OFF
mov ax, 250ch
int 21h
in al, SOUND_SWITCH ;Turn off speaker
and al, 11111100b
out SOUND_SWITCH, al
cmp CS:VIDEO_BASE, 0b000h ;Reset video adapter
je mode_7
mov al, 3h
jmp reset
mode_7: mov al, 7h
reset: mov ah, 0h
int 10h
pop si
pop ds
pop dx
pop ax
sti
ret
SHUTDOWN ENDP
;-------------------------------------------------------------------------------
; MAIN
;-------------------------------------------------------------------------------
main_begin: STARTUP
idle: jmp idle
end main_begin